<div id="lmscredentialsModal-<%= assignment.id %>" class="modal fade" role="dialog">
  <div class="modal-dialog primary-modal-dialog">
    <div class="modal-content">
      <div class="modal-header primary-modal-header">
        <h4 class="modal-title"><%= assignment.name %></h4>
        <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="close"></button>
      </div>
      <div class="modal-body">
        <h5>LMS Credentials</h5>
        <br>
        <div class="groups-lms-modal">
          <strong>Tool Url:</strong>
          <p id="toolurl" class="link-text"><%= URI.join request.original_url, "/lti/launch" %></p>
          <a class="btn primary-button groups-copy-lms-credentials-button" onclick="return copyToClipboard('#toolurl');">
            <%= image_tag("svgs/createCopy.svg", alt: "Create Copy") %>
          </a>
        </div>
        <div class="groups-lms-modal">
          <strong>Consumer Key:</strong>
          <p id="consumerkey-<%= assignment.id %>" class="link-text"><%= assignment.lti_consumer_key %></p>
          <a class="btn primary-button groups-copy-lms-credentials-button" onclick="return copyToClipboard('#consumerkey-<%= assignment.id %>');">
            <%= image_tag("svgs/createCopy.svg", alt: "Create Copy") %>
          </a>
        </div>
        <div class="groups-lms-modal">
          <strong>Shared Secret:</strong>
          <p id="sharedsecret-<%= assignment.id %>" class="link-text"><%= assignment.lti_shared_secret %></p>
          <a class="btn primary-button groups-copy-lms-credentials-button" onclick="return copyToClipboard('#sharedsecret-<%= assignment.id %>');">
            <%= image_tag("svgs/createCopy.svg", alt: "Create Copy") %>
          </a>
        </div>
        <br>
        <div>
          <a href=<%= lms_integration_tutorial %>>Learn how to integrate CircuitVerse assignments with any LMS</a>
        </div>
      </div>
    </div>
  </div>
</div>
<script type="text/javascript">
  function copyToClipboard(element) {
    setTimeout(function(){
      var $temp = $("<input>");
      $("body").append($temp);
      $temp.val($(element).text()).select();
      document.execCommand("copy");
      $temp.remove();
    },100);
  }
</script>
